package locations.actions;

import java.util.ArrayList;
import java.util.List;

import locations.dao.DAOFactory;
import locations.dao.InstitutionTypeDAO;
import locations.model.InstitutionType;

import com.opensymphony.xwork2.ActionSupport;

public class InstitutionTypeIndexAction extends ActionSupport {

	private String pageTitle = "Tipos de Instituciones";
	private List<InstitutionType> institutionTypes = new ArrayList();
	
	public String execute() throws Exception {
		
		InstitutionTypeDAO dao = DAOFactory.getInstitutionTypeDAO();
		this.setInstitutionTypes(dao.retrieveAll());
		return SUCCESS;
	}

	public String getPageTitle() {
		return pageTitle;
	}

	public void setPageTitle(String pageTitle) {
		this.pageTitle = pageTitle;
	}

	public List<InstitutionType> getInstitutionTypes() {
		return institutionTypes;
	}

	public void setInstitutionTypes(List<InstitutionType> institutionTypes) {
		this.institutionTypes = institutionTypes;
	}


	

}
